home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Tools / Preditor 2.0 / Macros / MarkCFunctions < prev    next >
Encoding:
Text File  |  1991-07-23  |  709 b   |  30 lines  |  [TEXT/TCEd]

  1. #
  2. #  MarkCFunctions
  3. #
  4. #  Marks all of the C functions in the window "~1" with the 
  5. #  name of the function.  This will produce a list of marks
  6. #  which contain a complete list of functions in the file, from
  7. #  which you can select and immediatly jump to that function
  8. #
  9. # The expected format for a function is:
  10. # <type> <function name>(
  11. #
  12.  
  13. Select(•, ~1)
  14.  
  15. while (Search("p", "^[A-Za-z_][A-Za-z0-9_]* [A-Za-z_][A-Za-z0-9_]*\\(", NULL, ~1)) 
  16.  
  17.     Select([§]≤0, ~1)
  18.     Search("p", "[A-Za-z_][A-Za-z0-9_]*\\(", NULL, ~1)
  19.     
  20.     /* Shrink the selection to remove the '(' */
  21.     
  22.     len = Length(Select([§]≤0:[§]≥-1, ~1))
  23.     If (len >= 32)
  24.         Select([§]≤0:[§]≤-30, ~1)
  25.     End
  26.     
  27.     Mark("y", §, Select(§, ~1), ~1)
  28.  
  29.     Select([»1]≤0, ~1)
  30. End